<template>
	<view>
		<u-navbar back-text="返回" :is-back="isBack" title="车型选择"></u-navbar>
		<view class="content">
			<u-row gutter="16">
				<u-col span="4" @click="click('c')">
					<u-image width="100%" height="200rpx" src="/static/car.png" style="text-align: center;"></u-image>
					<view class="grid-text"  style="text-align: center;">小车</view>
				</u-col>
				<u-col span="4" @click="click('b')">
					<u-image width="100%" height="200rpx" src="/static/truck.png"></u-image>
					<view class="grid-text" style="text-align: center;">货车</view>
				</u-col>
				<u-col span="4" @click="click('a')">
					<u-image width="100%" height="200rpx" src="/static/bus.png"></u-image>
					<view class="grid-text" style="text-align: center;">卡车</view>
				</u-col>
			</u-row>
			
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isBack:true
			}
		},
		onLoad(option) {
			this.isBack = Boolean(Number(option.blak))
		},
		methods: {
			click(e){
				let that = this;
				this.$u.api.updateUser({model:e}).then(res => {
					that.vuex_user = res.data;
					console.log(that.vuex_user)
					that.$refs.uToast.show({
						title: '保存成功',
						type: 'success',
						back : true
					})
				})
			}
		}
	}
</script>

<style>

</style>
